package MallCoreStatistics

import (
	CoreSQL "gitee.com/fotomxq/weeekj_core/v5/core/sql"
	Router2SystemConfig "gitee.com/fotomxq/weeekj_core/v5/router2/system_config"
)

type ArgsDeleteStatisticsWhere struct {
	//组织ID
	OrgID int64 `db:"org_id" json:"orgID"`
	//用户ID
	UserID int64 `db:"user_id" json:"userID"`
	//会员配置id
	MemberConfigID int64 `db:"member_config_id" json:"memberConfigID"`
	//商品ID
	GoodsID int64 `db:"goods_id" json:"goodsID"`
	//订单id
	OrderID int64 `db:"order_id" json:"orderID"`
	//用户会员有效日期
	MemberValidDate string `db:"member_valid_date" json:"memberValidDate"`
}

// DeleteStatisticsWhere 根据条件删除会员购买商品的统计
func DeleteStatisticsWhere(args *ArgsDeleteStatisticsWhere) (err error) {
	_, err = CoreSQL.DeleteAllSoft(Router2SystemConfig.MainDB.DB, "mall_core_statistics",
		"org_id =:org_id AND user_id = :user_id AND member_config_id = :member_config_id AND goods_id = :goods_id AND order_id = :order_id AND member_valid_date = :member_valid_date",
		args)
	if err != nil {
		return
	}
	//反馈
	return
}
